//
//  Fraction.m
//  OC _ 数组字典复习
//
//  Created by dllo on 15/12/7.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "Fraction.h"

@implementation Fraction

- (instancetype)initWithNum:(NSInteger)num
                       deno:(NSInteger)deno{
    
    self = [super init];
    if (self) {
        _num = num;
        _deno = deno;
    }
    return self;
}

- (Fraction *)addFraction:(Fraction *)fraction{
    
    Fraction *newFrac = [[Fraction alloc]init];
    /*新分数的分子*/
    newFrac.num = self.num * fraction.deno + self.deno * fraction.num;
    /*新分数的分母*/
    newFrac.deno = self.deno * fraction.deno;
    
    return newFrac;
}












@end
